package com.dpteam.service;

import com.dpteam.bean.UserInfo;
import com.dpteam.model.User;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created with IntelliJ IDEA.
 * User: luolei
 * Date: 2016/1/11
 * Time: 8:39
 */
public interface UserService {

    /**
     *
     * @param account
     * @param password
     * @return
     */
    UserInfo login(String account, String password)  throws UnknownAccountException, IncorrectCredentialsException;

    /**
     *
     * @return
     */
    boolean logout();

    /**
     *
     * @param updateInfo
     * @return
     */
    UserInfo updateUser(UserInfo updateInfo);

    /**
     *
     * @param oldPassword
     * @param newPassword
     * @return
     */
    boolean updatePass(String oldPassword, String newPassword);

    /**
     *
     * @param id
     * @return
     */
    User findById(int id);

    /**
     *
     * @param account
     * @return
     */
    User findByAccount(String account);

    /**
     *
     * @param phone
     * @return
     */
    User findByPhone(String phone);


}
